{include file="include/header1.html"}

<!-- topbar starts -->
{include file="include/header2.html"}
<!-- topbar ends -->
        <div class="container-fluid">
        <div class="row-fluid">
<!-- left menu starts -->
{include file="include/leftmenu.html"}
<!-- left menu ends -->
    <div id="content" class="span10">
			<!-- content starts -->
			<div>
				<ul class="breadcrumb">
					<li>
						<a href="#">首页</a> <span class="divider">/</span>
					</li>
					<li>
						<a href="#">菜单</a>
					</li>
				</ul>
			</div>
    <div class="row-fluid sortable">	
				<div class="box span12">
					<div class="box-header well" data-original-title>
						<h2><i class="icon-plus"></i>菜单编辑</h2>
						<div class="box-icon">
							<a href="#" class="btn btn-setting btn-round"><i class="icon-cog"></i></a>
							<a href="#" class="btn btn-minimize btn-round"><i class="icon-chevron-up"></i></a>
							<a href="#" class="btn btn-close btn-round"><i class="icon-remove"></i></a>
						</div>
					</div>
					<!--内容-->
                                        
                                        <div class="box-content">
                                            
                            <!-- #################################################### -->
                            <div class="row-fluid sortable ui-sortable">
				<!--span -->
                                <script type="text/javascript">
                                    function enabledselect(){
                                        $("select[name=myselect1]").removeAttr("disabled");
                                    }

                                    function disabledselect(){
                                        $("select[name=myselect1]").attr("disabled","disabled");
                                    }
                                </script>
                                <div class="box span6">
                                        <div class="box-header well">
                                                <h2><i class="icon-eye-open"></i> 编辑子菜单</h2>
                                                <div class="box-icon">
                                                        <a href="#" class="btn btn-setting btn-round"><i class="icon-cog"></i></a>
                                                        <a href="#" class="btn btn-minimize btn-round"><i class="icon-chevron-up"></i></a>
                                                        <a href="#" class="btn btn-close btn-round"><i class="icon-remove"></i></a>
                                                </div>
                                        </div>
                                        <div class="box-content">
                                            <form method="post" action="{$webpaths}?c=menuedit&a=editmenu">
                                                <input name="editsonmenuid" type="hidden" value="{$editsonmenuid}" />
                                            <p>名称:</p>
                                            <p><input type="text" name="menuname" value="{$editsonmenuname}" /></p>
                                            <p>类型:</p>
                                            {if $editsonmenutype eq "channel"}
                                            <p><label class="radio"><input type="radio" name="type" value="channel" checked="checked" onclick="disabledselect()" /> 文章分类目录</label></p>
                                            <p><label class="radio"><input type="radio" name="type" value="content" onclick="enabledselect()" /> 单页面</label><select name="myselect1"  disabled="disabled">{section name=i loop=$contentdata}<option value="{$contentdata[i].id}">{$contentdata[i].title}</option>{/section}</select></p>
                                            {elseif $editsonmenutype eq "content"}
                                            <p><label class="radio"><input type="radio" name="type" value="channel" onclick="disabledselect()" /> 文章分类目录</label></p>
                                            <p><label class="radio"><input type="radio" name="type" value="content"  checked="checked" onclick="enabledselect()" /> 单页面</label>&nbsp;<select name="myselect1" ><option value="{$editsonmenu_singlepageid}">{$editsonmenu_singlepagetitle}</option>{section name=i loop=$contentdata}<option value="{$contentdata[i].id}">{$contentdata[i].title}</option>{/section}</select></p>
                                            {/if}
                                            
                                            <p><input type="submit" class="btn btn-info" name="click" value="保存" /></p>
                                            </form>
                                        </div>
                                </div><!--/span-->	
			</div>
                            <!-- #################################################### -->
					</div>
                                        <!--内容-->
				</div><!--/span-->
				
			</div><!--/row-->
                        
    </div>

    </div>
    <hr />
    
    <script type="text/javascript">
        $("#myul1").dragsort({
                dragSelector: "div", 
                dragBetween: true, 
                dragEnd: saveOrder, 
                placeHolderTemplate: "<li class='placeHolder'><div></div></li>",
                scrollSpeed: 3
        });

        function saveOrder() {
                var data = $("#myul1 li").map(function(){
                        return $(this).children().html();
                }).get();
                $("input[name=list1SortOrder]").val(data.join("|"));
        };
    </script>
    
{include file="include/footer2.html"}
</div>
{include file="include/footer1.html"}